<?$this->_extends("_layouts/main_layout");?>
<?$this->_block("contents");?>
<script type="text/javascript">
<!--
function check(){
		return confirm('确定删除吗？');
	
}
//-->
</script>

<?php if (hp('banner.2')) {?>
<input type="button" class="btn1" value="添加"  onclick="window.location.href='<?php echo url('banner/create');?>';" style="width:80px;margin-top:7px;margin-bottom:7px;" />
<?php }?>
<table class="list_table" width="100%" cellpadding="0" cellspacing="0">
  <tr>
    <th>序号</th>
    <th>名称</th>
    <th>图片</th>
    <th>广告类型</th>
    <th>链接地址</th>
    <?php if (hp('banner.3')||hp('banner.4')) {?>
    <th>操作</th>
    <?php }?>
  </tr>
  <?php
	//print_r($list);
 foreach ($list as $i=>$row) {
	 ?>
  <tr>
    <td><?php echo $i+$start+1?></td>
    <td><?php echo $row['title']?></td>
    <td>
    <?php
    if(is_file($rootdir.$row['pic'])){
		//echo $rootdir.$row['pic'];
	
		
	?>
    <a href="<?php echo $_BASE_DIR.str_replace('\\','/',$row['pic']);?>" target="_blank"><img src="<?=$_BASE_DIR.$row['pic']?>" style="border:none;height:35px;"></a>
    <?php
	}
	?>
    </td>
    <td><?php if(array_key_exists($row['type_id'],$banner_type)){echo $banner_type[$row['type_id']];}?></td>
    <td><?php echo $row['the_url'];?></td>
    <?php if (hp('banner.3')||hp('banner.4')) {?>
    <td>
    	<?php if (hp('banner.3')) {?>
        <a href="<?=url('banner/edit', array('banner_id'=>$row['banner_id']))?>" style="color:blue;" title="修改">[修改]</a>&nbsp; 
        <?php }?>
        <?php if (hp('banner.4')) {?>
        <a href="<?=url('banner/delete', array('banner_id'=>$row['banner_id']))?>" onclick="return check()" style="color:blue;" title="删除">[删除]</a>
        <?php }?>
    </td>
    <?php }?>
  </tr>
  <? }?>
</table>
<br>
<? $this->_control("pagination", "", array('pagination'=>$pager));?>
<? $this->_endblock();?>
